<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><!--jstl-->
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 
<%@ page language="java" contentType="text/html; charset=UTF-8"%><!--设置页面以utf-8格式显示-->
<!DOCTYPE html>
<html lang="zn-CN">
<head>
    <!--添加 viewport 元数据标签,确保适当的绘制和触屏缩放-->
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Spring Boot Demo - FreeMarker</title>
	<!-- Bootstrap -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
	<link href="/static/css/index.css" rel="stylesheet" />
	<script type="text/javascript">
		$(function(){
			$(".deletbBtn").click(function(){
				if(window.confirm('你确定要删除吗？')){
	                 return true;
	              }else{
	                 return false;
	             }
			});
		})
	</script>
</head>
<body>
	<!--<img src="/static/images/logo.png" alt="logo"/>-->
	<h1 id="title">${title}</h1>	
	<form id="searchForm" action="/roles/list" method="post" role="form">
	   <div id="container">
			<div class="ui_content">
				<div class="ui_text_indent">
					<div id="box_border">
						<div id="box_top">搜索</div>
						<div id="box_bottom">
							<input type="button" value="新增" class="ui_input_btn01" onclick="location.href='/role/input'" /> 
						</div>
					</div>
				</div>
	   </div>
	   <div class="ui_content">
				<div class="ui_tb">
					<table class="table table-hover table-bordered text-center" cellspacing="0" cellpadding="0" width="100%" align="center" border="0">
						<thead class="text-center">
						<tr>
							<th width="30"><input type="checkbox" id="all" /></th>
							<th>角色id</th>
							<th>角色名称</th>
							<th>角色编码</th>
							<th>权限</th>
							<th>操作</th>
						</tr>
						</thead>
						<tbody>
						    <c:forEach items="${roleList}" var="role">
							<tr>
								<td><input type="checkbox" name="IDCheck" class="acb" /></td>
								<td>${role.id}</td>
								<td>${role.name}</td>
								<td>${role.sn}</td>
								<td>
								<c:forEach items="${role.permissions}" var="permissions">
								${permissions.name}
								</c:forEach>
								</td>
								<td>
									<a href="/role/input?id=${role.id}">编辑</a>
									<a class="deletbBtn" href="/role/drop?id=${role.id}"/>删除</a>
								</td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
				</div>
				</div>
	</form>
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="/static/js/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="/static/js/bootstrap.min.js"></script>
</body>
</html>
